package cn.tx.controller;

import cn.tx.dubbo.client.UserInfoService;
import cn.tx.pojo.domain.User;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("order/user")
public class UserInfoController {

    //dubbo提供的Reference注解，用于调用远程服务
    @DubboReference(check = false)
    private UserInfoService userInfoService;

    @GetMapping("/getInfo")
    public User getInfo(){
        return userInfoService.getUserInfo();
    }

}
